feat(search): use stable node IDs for split affinity to keep disk cache warm when searcher pods restart - #6711
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 057b3f7124
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| impl Hash for SocketAddrAndClient { | ||
| impl Hash for NodeIdAndClient { | ||
| fn hash<H: Hasher>(&self, hasher: &mut H) { | ||
| SocketAddrLegacyHash(&self.socket_addr).hash(hasher); |
There was a problem hiding this comment.
unless it's still used somewhere, can we remove SocketAddrLegacyHash from quickwit-common, it's probably dead code after this PR
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Rendezvous hashing previously keyed off gRPC addresses, so a searcher restart that kept QW_NODE_ID but changed listen address remapped every split. Hash the cluster node ID instead, while keeping the searcher pool keyed by address for RPC.
The helper no longer stores a socket address; rendezvous hashing uses node_id only.
Rendezvous hashing now keys off node IDs, so the pre-Rust-1.81 socket address hash wrapper is unused.
80a3c75 to
2d6ce07
Compare
This is independent of the split-range disk cache stack. It is useful for cache locality after a same-node restart, but it does not require that cache.
Summary
report_splits) now hashes the clusternode_id/QW_NODE_IDinstead of the gRPCSocketAddr.node_iddocs note that searchers should keep this ID stable (for example a StatefulSet pod name) if the same splits should keep landing on the same node.What this does not fix
QW_NODE_IDis a random Deployment hostname, affinity is still unstable. The default remains the short hostname.node_idis unchanged.put_kv/get_kvshare this ranking. While old and new coordinators coexist, an in-flight scroll can miss a live replica (possible at 8+ searchers). Homogeneous fleet and replica restarts are unchanged from today; MiniKV is still in-memory.Test plan
cargo test -p quickwit-search --all-features --libcargo test -p quickwit-serve --all-features --lib -- setup_searcher datafusion_workercargo test -p quickwit-janitor --all-features --libcargo test -p quickwit-datafusion --all-featurescargo clippy -p quickwit-search -p quickwit-serve -p quickwit-datafusion --all-features --tests -- -D warningsQW_NODE_IDand a changed gRPC port keeps the same split assignment